package com.mjk.manager.api.constns;

import com.mjk.common.util.StrUtils;
import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
public enum ApiStatus {
	CLOSE("0","关闭"),
	OPEN("1","打开");	
	private String type;
	private String remark;
	ApiStatus(String type,String remark){
		this.remark = remark;
		this.type = type;
	}


	public static Map<String, String> toMap() {
		ApiStatus[] ary = values();
		Map<String, String> enumMap = new HashMap<>();
        for (ApiStatus apiStatus : ary) {
            enumMap.put(apiStatus.getType(), apiStatus.getRemark());
        }
		return enumMap;
	}
	
	public static String getAllRole(){
		ApiStatus[] ary = values();
		List<String> roles = new ArrayList<>();
        for (ApiStatus apiStatus : ary) {
            roles.add(apiStatus.getType());
        }
		return StrUtils.join(roles, ",");
	}


}
